<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2025/9/9
  Time: 10:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>手机列表</title>
</head>
<body>
<h1>欢迎</h1>
<a href="/addphone.jsp">添加宠物</a>
<table border="1px" width="400px">
  <tr>
    <th>编号</th><th>库存</th><th>名称</th><th>类型</th><th>价格</th><th>生产日期</th><th>操作</th>
  </tr>
  <c:forEach var="phone" items="${phones}">
    <tr>
      <td>${phone.id}</td>
      <td>${phone.inventory}</td>
      <td>${phone.name}</td>
      <td>${phone.type}</td>
      <td>${phone.price}</td>
      <td>${phone.date}</td>
      <td>
        <a href="/updatePhone.do?id=${phone.id}">更新</a> &nbsp;
        <a href="javascript:if(confirm('是否确定删除?'))location.href='/removePhone.do?id=${phone.id}'">删除</a>
      </td>
    </tr>
  </c:forEach>
</table>
</body>
</html>
